﻿namespace Admin.NET.Application.Service;

/// <summary>
/// 科室资料
/// </summary>
public class SysOrgService : IDynamicApiController
{

    protected readonly SqlSugarRepository<SysOrg> _rep;
    public SysOrgService(SqlSugarRepository<SysOrg> rep) 
    {
        _rep = rep;
    }

    /// <summary>
    /// 获取所有科室资料, 用于前端缓存
    /// </summary>
   [AllowAnonymous]
    public async Task<List<SysOrgAllOutput>> All()
    {
        return await _rep.Queryable
            .OrderBy(it => new { it.OrderNo })
            .Select<SysOrgAllOutput>()
            .ToListAsync();
    }

}